package com.token.controller;

import com.token.model.dto.TestSqlInfoDTO;
import com.token.service.TestSqlInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

/**
 * @auther: henriy
 * @Date: 2023/10/30
 */
@Api(tags = "导出接口类")
@RestController
@RequestMapping("/test/export")
public class TestSqlInfoController {

    @Resource
    private TestSqlInfoService testSqlInfoService;

    @PostMapping("/excel")
    @ApiOperation("导出1")
    public void export(@Validated @RequestBody TestSqlInfoDTO testSqlInfoDTO, HttpServletResponse response) throws Exception {
        testSqlInfoService.export(testSqlInfoDTO, response);
    }

    @PostMapping("/excel2")
    @ApiOperation("导出2")
    public void export2(@Validated @RequestBody TestSqlInfoDTO testSqlInfoDTO, HttpServletResponse response) throws Exception {
        testSqlInfoService.export2(testSqlInfoDTO, response);
    }


}
